use "../data/parties.dta"

* In/out sample dummy
gen insample=0
replace insample=1 if country_code==1100
replace insample=1 if country_code==1203
replace insample=1 if country_code==1250
replace insample=1 if country_code==1276
replace insample=1 if country_code==1300
replace insample=1 if country_code==1348
replace insample=1 if country_code==1380
replace insample=1 if country_code==1528
replace insample=1 if country_code==1642
replace insample=1 if country_code==1724
replace insample=1 if country_code==1826

* Drop parties that didn't elect at least 1 MEP.
drop if v1_10 == 0 | v1_10 == .

* generate big 3 variable

gen big3dummy=0
replace big3dummy=1 if v1_111stgroup==1
replace big3dummy=1 if v1_111stgroup==2
replace big3dummy=1 if v1_111stgroup==3

* rename for convenience
rename v1_12 ingov

*Generate EU emphasis from PIRDEU data

gen generaleuemphasis=per_v1_110+per_v2_110+per_v3_110+per_v4_110+per_v1_108+per_v2_108+per_v3_108+per_v4_108

* Out of sample
sum propseats ingov generaleuemphasis big3dummy pro_anti_eu if insample==0

* in sample
sum propseats ingov generaleuemphasis big3dummy pro_anti_eu if insample==1

* T-tests
hotelling propseats ingov generaleuemphasis big3dummy pro_anti_eu, by(insample)
ttest ingov, by(insample)
ttest generaleuemphasis, by(insample)
ttest big3dummy, by(insample)
ttest pro_anti_eu, by(insample)
